load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_library")

package(default_visibility = ["//visibility:public"])

exports_files(
    glob([
        "*.h",
        "*.cpp",
        "*.inl",
    ]),
)

idl_generator(
    name = "coordinator_document_gen",
    src = "coordinator_document.idl",
    deps = [
        "//src/mongo/s/resharding:common_types_gen",
    ],
)

idl_generator(
    name = "reshard_collection_coordinator_document_gen",
    src = "reshard_collection_coordinator_document.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
        "//src/mongo/db/global_catalog/ddl:sharded_ddl_commands_gen",
        "//src/mongo/db/global_catalog/ddl:sharding_ddl_coordinator_gen",
    ],
)

idl_generator(
    name = "donor_document_gen",
    src = "donor_document.idl",
    deps = [
        "//src/mongo/s/resharding:common_types_gen",
    ],
)

idl_generator(
    name = "donor_oplog_id_gen",
    src = "donor_oplog_id.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)

idl_generator(
    name = "recipient_document_gen",
    src = "recipient_document.idl",
    deps = [
        "//src/mongo/s/resharding:common_types_gen",
    ],
)

idl_generator(
    name = "recipient_resume_document_gen",
    src = "recipient_resume_document.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
        "//src/mongo/db/sharding_environment:sharding_types_gen",
        "//src/mongo/s/resharding:common_types_gen",
        "//src/mongo/util/net:hostandport_gen",
    ],
)

idl_generator(
    name = "resharding_noop_o2_field_gen",
    src = "resharding_noop_o2_field.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)

idl_generator(
    name = "resharding_change_event_o2_field_gen",
    src = "resharding_change_event_o2_field.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)

idl_generator(
    name = "resharding_oplog_applier_progress_gen",
    src = "resharding_oplog_applier_progress.idl",
    deps = [
        ":donor_oplog_id_gen",
        "//src/mongo/db:basic_types_gen",
        "//src/mongo/db/sharding_environment:sharding_types_gen",
        "//src/mongo/s/resharding:common_types_gen",
    ],
)

idl_generator(
    name = "resharding_oplog_fetcher_progress_gen",
    src = "resharding_oplog_fetcher_progress.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
        "//src/mongo/db/sharding_environment:sharding_types_gen",
        "//src/mongo/s/resharding:common_types_gen",
    ],
)

idl_generator(
    name = "resharding_txn_cloner_progress_gen",
    src = "resharding_txn_cloner_progress.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
        "//src/mongo/db/session:logical_session_id_gen",
        "//src/mongo/db/sharding_environment:sharding_types_gen",
        "//src/mongo/s/resharding:common_types_gen",
    ],
)

idl_generator(
    name = "resharding_server_parameters_gen",
    src = "resharding_server_parameters.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)
